<template>
	<view>
		<view class="nav">
			<view class="nav-list">
				<view class="nav-item" :class="{'active':navIndex==index}" v-for="(item,index) in navList" :key="index"
					@tap="navTap(index)">
					{{item}}
				</view>
			</view>
		</view>
		<Incubate v-if="navIndex==0" />
		<Acquisitions v-else />
	</view>
</template>

<script>
	import Acquisitions from "./Acquisitions.vue";
	import Incubate from "./Incubate.vue";
	export default {
		components: {
			Acquisitions,
			Incubate,
		},
		data() {
			return {
				navIndex: 0,
				navList: ['企业孵化', '兼收并购'],
			}
		},
		onShow() {
			// this.navIndex = 0
		},
		methods: {
			navTap(index) {
				this.navIndex = index
			}
		}
	}
</script>

<style lang="less">
	page {
		background-color: #ECEDEE;

		.nav {
			padding: 20rpx 24rpx 0 24rpx;
			box-sizing: border-box;

			.nav-list {
				box-sizing: border-box;
				border: 1rpx solid #0B4E9E;
				border-radius: 40rpx;
				display: flex;
				background-color: #fff;
				align-items: center;
				text-align: center;
				overflow: hidden;

				.nav-item {
					flex: auto;
					height: 64rpx;
					line-height: 64rpx;
					color: #0B4E9E;
					font-weight: 600;
				}

				.active {
					color: #fff;
					font-weight: 600;
					background-color: #0B4E9E;
					border-radius: 32rpx;
				}
			}


		}
	}
</style>
